<!DOCTYPE html>
<html>
    <head>
        <title>Laravel</title>

        <link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">

        <meta name="csrf-token" content="{{ csrf_token() }}">
        <style>
            html, body {
                height: 100%;
            }

            body {
                margin: 0;
                padding: 0;
                width: 100%;
                display: table;
                font-weight: 100;
                font-family: 'Lato';
            }

            .container {
                text-align: center;
                display: table-cell;
                vertical-align: middle;
            }

            .content {
                text-align: center;
                display: inline-block;
            }

            .title {
                font-size: 96px;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <div class="content">
                <div class="title">Laravel 5</div>
            </div>
            <div id="hrSignup">
                <span>hr注册</span>
                <input type="text" name="mobile" placeholder="mobile"/>
                <input type="text" name="captcha" placeholder="captcha"/>
                <input type="text" name="code" placeholder="code">
                <input type="password" name="password" placeholder="password">
                <a href="javascript:;" id="doHrSignup">注册</a>
            </div>
            <div id="companySignup">
                <span>企业注册</span>
                <input type="text" name="email" placeholder="email"/>
                <input type="password" name="password" placeholder="password">
                <a href="javascript:;" id="doCompanySignup">注册</a>
            </div>
            <hr>
            <div id="hrSignin">
                <span>hr登陆</span>
                <input type="text" name="mobile" placeholder="mobile"/>
                <input type="password" name="password" placeholder="password">
                <a href="javascript:;" id="doHrSignin">登陆</a>
            </div>
            <div id="companySignin">
                <span>企业登陆</span>
                <input type="text" name="email" placeholder="email"/>
                <input type="password" name="password" placeholder="password">
                <a href="javascript:;" id="doCompanySignin">登陆</a>
            </div>
            <hr>
            <div><a href="{{ url("/admin/login") }}">管理登陆</a>
        </div>
    <script src="{{ config('app.static_url') }}assets/global/plugins/jquery.min.js" type="text/javascript"></script>
    <script src="{{ config('app.static_url') }}assets/global/scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        var doHrSignupFunc = function() {
            var formDom = $('#hrSignup');
            var mobile = formDom.find('input[name=mobile]').val();
            var password = formDom.find('input[name=password]').val();

            $.ajax({
                url: '{{ url('/hr/signup') }}',
                type: 'post',
                datatype: 'json',
                formDom: formDom,
                bindDom: $("#doHrSignup"),
                bindType: 'click',
                bindFunc: doHrSignupFunc,
                data: {mobile: mobile, password: password}
            });
        };
        var doCompanySignupFunc = function() {
            var formDom = $('#companySignup');
            var email = formDom.find('input[name=email]').val();
            var password = formDom.find('input[name=password]').val();

            $.ajax({
                url: '{{ url('/company/signup') }}',
                type: 'post',
                datatype: 'json',
                formDom: formDom,
                bindDom: $("#doCompanySignup"),
                bindType: 'click',
                bindFunc: doCompanySignupFunc,
                data: {email: email, password: password}
            });
        };

        var doHrSigninFunc = function() {
            var formDom = $('#hrSignin');
            var mobile = formDom.find('input[name=mobile]').val();
            var password = formDom.find('input[name=password]').val();

            $.ajax({
                url: '{{ url('/hr/signin') }}',
                type: 'put',
                datatype: 'json',
                formDom: formDom,
                bindDom: $("#doHrSignin"),
                bindType: 'click',
                bindFunc: doHrSigninFunc,
                data: {mobile: mobile, password: password}
            });
        };
        var doCompanySigninFunc = function() {
            var formDom = $('#companySignin');
            var email = formDom.find('input[name=email]').val();
            var password = formDom.find('input[name=password]').val();

            $.ajax({
                url: '{{ url('/company/signin') }}',
                type: 'put',
                datatype: 'json',
                formDom: formDom,
                bindDom: $("#doCompanySignin"),
                bindType: 'click',
                bindFunc: doCompanySigninFunc,
                data: {email: email, password: password}
            });
        };
        $(function() {
            $("#doHrSignup").bind("click", doHrSignupFunc);
            $("#doCompanySignup").bind("click", doCompanySignupFunc);
            $("#doHrSignin").bind("click", doHrSigninFunc);
            $("#doCompanySignin").bind("click", doCompanySigninFunc);
        });

        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
        ga('create', 'UA-79045700-1', 'auto');
        ga('send', 'pageview');
    </script>
    </body>
</html>
